﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Internal.Master" Inherits="BPM.Web.ViewPage" %>

<asp:Content ID="c1" ContentPlaceHolderID="TitleContent" runat="server">
	<%
		var product = this.ViewData["Product"] as ProductAssembleDefinition;
	%>
	成品组装 -
	<%= product.Name %>
</asp:Content>
<asp:Content ID="c3" ContentPlaceHolderID="ScriptStyleContent" runat="server">
	<style type="text/css">
		legend
		{
			font-weight: bold;
			color: Orange;
			font-size: 14px;
		}
		.materialFieldset
		{
			padding: 50px 20px 20px 20px;
		}
		#warning
		{
			margin: 10px;
			color: Red;
			font-size: large;
			text-align: center;
		}
	</style>
	<script type="text/javascript">
		product = <%= this.ViewData["ProductJson"] %>;
	</script>
</asp:Content>
<asp:Content ID="c2" ContentPlaceHolderID="MainContent" runat="server">
	<%
		var product = this.ViewData["Product"] as ProductAssembleDefinition;
	%>
	<div>
		<div id="warning">
			请刷条码
		</div>
		<div>
			<fieldset class="materialFieldset">
				<legend>物料列表</legend>
				<table class="altTable" id="materials" cellpadding="0" cellspacing="0">
					<thead>
						<tr>
							<td>
								物料图片
							</td>
							<td>
								物料条码
							</td>
							<td>
								物料名称
							</td>
							<td>
								当前数量
							</td>
							<td>
								需要的数量
							</td>
						</tr>
					</thead>
					<tbody>
						<%
							foreach (var item in product.ItemList)
							{
								var material = item.MaterialDefinition;
								
						%>
						<tr>
							<td>
								<img src="<%=Url.Content(material.ImagePath) %>" />
							</td>
							<td>
								<%=material.Barcode.Number %>
							</td>
							<td>
								<%=material.Name %>
							</td>
							<td id="amount_<%=material.Id %>" style="color: Red;">
								0
							</td>
							<td>
								<%=item.Amount%>
							</td>
						</tr>
						<%
							}
						%>
					</tbody>
				</table>
			</fieldset>
		</div>
		<div>
			<input id="btnSubmit" type="button" value="提交" onclick="submitAllData()" />
			<input id="btnPrint" type="button" value="打印" onclick="printProduct()" />
			<input id="btnRefresh" type="button" value="继续组装" onclick="startNewProduct()" />
		</div>
	</div>
</asp:Content>
